function cmd = setWeights(varargin)
nIn = length(varargin);

switch nIn
    case 1
        weightsfile = varargin{1};
    case 2
        [cmd, weightsfile] = varargin{:};
        cmd = mycaffe.rmFields(cmd, 'snapshot');
end

weightsfile = srdata.checkFileFormat(weightsfile, '.caffemodel');

if nIn == 1
    cmd = weightsfile;
    return
end

cmd.weights = weightsfile;
